# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  A M S   -   A d v a n c e d   M e s s a g e   S c r i p t   -   R 4   [ U p d a t e   # 2 ] 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   F o r   m o r e   i n f o s   a n d   u p d a t e ,   v i s i t : 
 
 #   w w w . d u b e a l e x . c o m   ( C r e a t i o n   A s y l u m ) 
 
 # 
 
 #   E d i t e d ,   F i x e d   a n d   E n h a n c e d   b y :   D u b e a l e x 
 
 #   O r i g i n a l   S c r i p t   C o r e   b y :   X R X S   S c r i p t e r   ( J a p   D u d e s ) 
 
 #   H T M L   H e x a d e c i m a l   c o l o r   f e a t u r e   f r o m :   P h y l o m o r p h i s   
 
 # 
 
 #   S p e c i a l   T h a n k s : 
 
 #   R a b u :   F o r   e n a b l i n g   t h e   S h o w   F a c e   f e a t u r e   i n   a n   e n c r y p t e d   p r o j e c t 
 
 # 
 
 #   T o   f o u n d   a l l   m y   n e w   f e a t u r e s ,   s e a r c h   t h e   f o l l o w i n g :     # N E W 
 
 #   T o   c o n f i g u r e   t h e   b u t t o n   t o   s k i p   t h e   d i a l o g ,   s e a r c h :     # S K I P _ T E X T _ C O D E 
 
 # 
 
 #   M a y   1 8 ,   2 0 0 5 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 L E T T E R _ B Y _ L E T T E R _ M O D E   =   t r u e       # S e t   t h e   l e t t e r   b y   l e t t e r   m o d e   O N / O F F                     
 
 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   A M S   B e g i n s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 c l a s s   A M S 
 
   
 
   a t t r _ a c c e s s o r   : n a m e _ b o x _ x _ o f f s e t 
 
   a t t r _ a c c e s s o r   : n a m e _ b o x _ y _ o f f s e t   
 
   a t t r _ a c c e s s o r   : f o n t _ t y p e 
 
   a t t r _ a c c e s s o r   : n a m e _ f o n t _ t y p e 
 
   a t t r _ a c c e s s o r   : f o n t _ s i z e 
 
   a t t r _ a c c e s s o r   : n a m e _ f o n t _ s i z e 
 
   a t t r _ a c c e s s o r   : m e s s a g e _ b o x _ o p a c i t y   
 
   a t t r _ a c c e s s o r   : n a m e _ b o x _ s k i n 
 
   a t t r _ a c c e s s o r   : n a m e _ b o x _ t e x t _ c o l o r 
 
   a t t r _ a c c e s s o r   : m e s s a g e _ b o x _ t e x t _ c o l o r 
 
   a t t r _ a c c e s s o r   : m e s s a g e _ b o x _ s k i n 
 
   a t t r _ a c c e s s o r   : n a m e _ b o x _ w i d t h 
 
   a t t r _ a c c e s s o r   : n a m e _ b o x _ h e i g h t 
 
   a t t r _ a c c e s s o r   : m e s s a g e _ w i d t h 
 
   a t t r _ a c c e s s o r   : m e s s a g e _ h e i g h t 
 
   a t t r _ a c c e s s o r   : m e s s a g e _ x 
 
   a t t r _ a c c e s s o r   : m e s s a g e _ y _ b o t t o m 
 
   a t t r _ a c c e s s o r   : m e s s a g e _ y _ m i d d l e 
 
   a t t r _ a c c e s s o r   : m e s s a g e _ y _ t o p 
 
   a t t r _ a c c e s s o r   : e v e n t _ m e s s a g e _ x _ o f s e t 
 
   a t t r _ a c c e s s o r   : e v e n t _ m e s s a g e _ y _ o f s e t 
 
     
 
 d e f   i n i t i a l i z e 
 
     
 
   @ n a m e _ b o x _ x _ o f f s e t   =   0               # C h o o s e   t h e   X   a x i s   o f f s e t   o f   t h e   n a m e   b o s .   d e f a u l t =   0 
 
   @ n a m e _ b o x _ y _ o f f s e t   =   - 1 0         # C h o o s e   t h e   Y   a x i s   o f f s e t   o f   t h e   n a m e   b o s .   d e f a u l t =   - 1 0 
 
   @ n a m e _ b o x _ w i d t h   =   8                       # C h o o s e   t h e   w i d t h   o f   t h e   N a m e   B o x .   d e f a u l t =   8     
 
   @ n a m e _ b o x _ h e i g h t   =   2 6                 # C h o o s e   t h e   h e i g h t   o f   t h e   N a m e   B o x .   d e f a u l t =   2 6 
 
   
 
   @ f o n t _ t y p e   =   " T a h o m a "                       # C h o o s e   t h e   F o n t   N a m e   ( C a s e   S e n s i t i v e )   f o r   m e s s a g e   b o x 
 
   @ n a m e _ f o n t _ t y p e   =   " T a h o m a "   # C h o o s e   t h e   F o n t   N a m e   ( C a s e   S e n s i t i v e )   f o r   N a m e   B o x 
 
   @ f o n t _ s i z e   =   2 2                                             # C h o o s e   t h e   d e f a u l t   F o n t   S i z e   f o r   m e s s a g e   b o x   t e x t 
 
   @ n a m e _ f o n t _ s i z e   =   2 2                         # C h o o s e   t h e   d e a f a u l t   F o n t   S i z e   f o r   N a m e   B o x   t e x t 
 
   @ n a m e _ b o x _ t e x t _ c o l o r = 0                 # C h o o s e   t h e   T e x t   C o l o r   o f   t h e   N a m e   B o x 
 
   @ m e s s a g e _ b o x _ t e x t _ c o l o r = 0       # C h o o s e   t h e   T e x t   C o l o r   o f   t h e   M e s s a g e   B o x 
 
   
 
   @ m e s s a g e _ b o x _ o p a c i t y   =   1 6 0                         # C h o o s e   t h e   o p a c i t y   o f   t h e   m e s s a g e   w i n d o w .   D e f a u l t = 1 6 0 
 
   @ m e s s a g e _ b o x _ s k i n   =   " 0 0 1 - B l u e 0 1 "       # C h o o s e   t h e   W i n d o w S k i n   f o r   t h e   M e s s a g e   B o x 
 
   @ n a m e _ b o x _ s k i n   =   " 0 0 1 - B l u e 0 1 "               # C h o o s e   t h e   W i n d o w S k i n   f o r   t h e   N a m e   B o x 
 
   
 
   @ m e s s a g e _ w i d t h   =   4 8 0                     # C h o o s e   t h e   w i d t h   s i z e   o f   t h e   m e s s a g e   b o x .   D e f a u l t = 4 8 0 
 
   @ m e s s a g e _ h e i g h t   =   1 6 0                   # C h o o s e   t h e   h e i g h t   s i z e   o f   t h e   m e s s a g e   b o x .   D e f a u l t = 1 6 0 
 
   @ m e s s a g e _ x   =   8 0                                     # C h o o s e   t h e   X   p o s i t i o n   o f   t h e   m e s s a g e   b o x .   D e f a u l t = 8 0 
 
   @ m e s s a g e _ y _ b o t t o m   =   3 0 4         # C h o o s e   t h e   Y   b o t t o m   p o s i t i o n   o f   t h e   m e s s a g e   b o x .   D e f a u l t = 3 0 4 
 
   @ m e s s a g e _ y _ m i d d l e   =   1 6 0         # C h o o s e   t h e   Y   m i d d l e   p o s i t i o n   o f   t h e   m e s s a g e   b o x .   D e f a u l t = 1 6 0 
 
   @ m e s s a g e _ y _ t o p   =   1 6                       # C h o o s e   t h e   Y   t o p   p o s i t i o n   o f   t h e   m e s s a g e   b o x .   D e f a u l t = 1 6 
 
   
 
   @ e v e n t _ m e s s a g e _ x _ o f s e t   =   0       # C h o o s e   t h e   X   p o s i t i o n   o f f s e t   o f   t h e   e v e n t   m e s s a g e .   D e f a u l t = 0 
 
   @ e v e n t _ m e s s a g e _ y _ o f s e t   =   4 8       # C h o o s e   t h e   Y   p o s i t i o n   o f f s e t   o f   t h e   e v e n t   m e s s a g e .   D e f a u l t = 4 8 
 
   
 
 e n d 
 
 e n d 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   A M S   E n d s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C l a s s   W i n d o w _ M e s s a g e   B e g i n s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 c l a s s   W i n d o w _ M e s s a g e   <   W i n d o w _ S e l e c t a b l e       
 
 
 
 a l i a s   x r x s 9 _ i n i t i a l i z e   i n i t i a l i z e 
 
 
 
 d e f   i n i t i a l i z e 
 
 
 
 @ a l e x _ s k i p   =   f a l s e 
 
 
 
 x r x s 9 _ i n i t i a l i z e 
 
 
 
 i f   $ s o u n d n a m e _ o n _ s p e a k   = =   n i l   t h e n 
 
     $ s o u n d n a m e _ o n _ s p e a k   =   " " 
 
 e n d 
 
 
 
 $ g a i j i _ f i l e   =   " . / G r a p h i c s / G a i j i / s a m p l e . p n g " 
 
 
 
 i f   F i l e T e s t . e x i s t ? ( $ g a i j i _ f i l e ) 
 
     @ g a i j i _ c a c h e   =   B i t m a p . n e w ( $ g a i j i _ f i l e ) 
 
 e l s e 
 
     @ g a i g i _ c a c h e   =   n i l 
 
 e n d 
 
 @ o p a c i t y _ t e x t _ b u f   =   B i t m a p . n e w ( 3 2 ,   3 2 ) 
 
 e n d 
 
 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 a l i a s   x r x s 9 _ t e r m i n a t e _ m e s s a g e   t e r m i n a t e _ m e s s a g e 
 
 
 
 d e f   t e r m i n a t e _ m e s s a g e 
 
   
 
 i f   @ n a m e _ w i n d o w _ f r a m e   ! =   n i l 
 
     @ n a m e _ w i n d o w _ f r a m e . d i s p o s e 
 
     @ n a m e _ w i n d o w _ f r a m e   =   n i l 
 
 e n d 
 
 
 
 i f   @ n a m e _ w i n d o w _ t e x t     ! =   n i l 
 
     @ n a m e _ w i n d o w _ t e x t . d i s p o s e 
 
     @ n a m e _ w i n d o w _ t e x t     =   n i l 
 
 e n d 
 
 x r x s 9 _ t e r m i n a t e _ m e s s a g e 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   r e f r e s h 
 
   
 
 s e l f . c o n t e n t s . c l e a r 
 
 s e l f . c o n t e n t s . f o n t . c o l o r   =   t e x t _ c o l o r ( $ a m s . m e s s a g e _ b o x _ t e x t _ c o l o r ) 
 
 s e l f . c o n t e n t s . f o n t . n a m e   =   $ a m s . f o n t _ t y p e 
 
 s e l f . c o n t e n t s . f o n t . s i z e   =   $ a m s . f o n t _ s i z e 
 
 s e l f . w i n d o w s k i n   =   R P G : : C a c h e . w i n d o w s k i n ( $ a m s . m e s s a g e _ b o x _ s k i n ) 
 
 @ x   =   @ y   =   @ m a x _ x   =   @ m a x _ y   =   @ i n d e n t   =   @ l i n e s   =   0 
 
 @ f a c e _ i n d e n t   =   0 
 
 @ o p a c i t y   =   2 5 5 
 
 @ c u r s o r _ w i d t h   =   0 
 
 @ w r i t e _ s p e e d   =   0 
 
 @ w r i t e _ w a i t   =   0 
 
 @ m i d _ s t o p   =   f a l s e 
 
 @ f a c e _ f i l e   =   n i l 
 
 @ p o p c h a r   =   - 2 
 
 
 
 i f   $ g a m e _ t e m p . c h o i c e _ s t a r t   = =   0 
 
     @ x   =   8 
 
 e n d 
 
 
 
 i f   $ g a m e _ t e m p . m e s s a g e _ t e x t   ! =   n i l 
 
     @ n o w _ t e x t   =   $ g a m e _ t e m p . m e s s a g e _ t e x t 
 
     i f   ( / \ A \ \ [ F f ] \ [ ( . + ? ) \ ] / . m a t c h ( @ n o w _ t e x t ) ) ! = n i l   t h e n 
 
           @ f a c e _ f i l e   =   $ 1   +   " . p n g " 
 
           @ x   =   @ f a c e _ i n d e n t   =   1 2 8 
 
         i f   F i l e T e s t . e x i s t ? ( " G r a p h i c s / P i c t u r e s / "   +   $ 1   +   " . p n g " ) 
 
             s e l f . c o n t e n t s . b l t ( 1 6 ,   1 6 ,   R P G : : C a c h e . p i c t u r e ( @ f a c e _ f i l e ) ,   R e c t . n e w ( 0 ,   0 ,   9 6 ,   9 6 ) ) 
 
         e n d 
 
         @ n o w _ t e x t . g s u b ! ( / \ \ [ F f ] \ [ ( . * ? ) \ ] / )   {   " "   } 
 
     e n d 
 
 
 
     b e g i n 
 
     l a s t _ t e x t   =   @ n o w _ t e x t . c l o n e 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ V v ] \ [ ( [ I i W w A a S s ] ? ) ( [ 0 - 9 ] + ) \ ] / )   {   c o n v a r t _ v a l u e ( $ 1 ,   $ 2 . t o _ i )   } 
 
     e n d   u n t i l   @ n o w _ t e x t   = =   l a s t _ t e x t 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ N n ] \ [ ( [ 0 - 9 ] + ) \ ] / )   d o 
 
         $ g a m e _ a c t o r s [ $ 1 . t o _ i ]   ! =   n i l   ?   $ g a m e _ a c t o r s [ $ 1 . t o _ i ] . n a m e   :   " " 
 
       e n d 
 
     
 
     # N E W 
 
     # D u b e a l e x ' s   S t o p   S k i p   T e x t   O N - O F F 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ % ] / )   {   " \ 1 0 0 "   } 
 
     # E n d   n e w   c o m m a n d 
 
       
 
     # N E W 
 
     # D u b e a l e x ' s   S h o w   M o n s t e r   N a m e   F e a t u r e 
 
       @ n o w _ t e x t . g s u b ! ( / \ \ [ M m ] \ [ ( [ 0 - 9 ] + ) \ ] / )   d o 
 
       $ d a t a _ e n e m i e s [ $ 1 . t o _ i ]   ! =   n i l   ?   $ d a t a _ e n e m i e s [ $ 1 . t o _ i ] . n a m e   :   " " 
 
       e n d 
 
       # E n d   n e w   c o m m a n d 
 
       
 
     # N E W 
 
     # D u b e a l e x ' s   S h o w   I t e m   P r i c e   F e a t u r e 
 
       @ n o w _ t e x t . g s u b ! ( / \ \ [ P p ] r i c e \ [ ( [ 0 - 9 ] + ) \ ] / )   d o 
 
       $ d a t a _ i t e m s [ $ 1 . t o _ i ]   ! =   n i l   ?   $ d a t a _ i t e m s [ $ 1 . t o _ i ] . p r i c e   :   " " 
 
       e n d 
 
       # E n d   n e w   c o m m a n d 
 
       
 
     # N E W 
 
     # D u b e a l e x ' s   S h o w   H e r o   C l a s s   N a m e   F e a t u r e 
 
       @ n o w _ t e x t . g s u b ! ( / \ \ [ C c ] l a s s \ [ ( [ 0 - 9 ] + ) \ ] / )   d o 
 
       $ d a t a _ c l a s s e s [ $ d a t a _ a c t o r s [ $ 1 . t o _ i ] . c l a s s _ i d ]   ! =   n i l   ?   $ d a t a _ c l a s s e s [ $ d a t a _ a c t o r s [ $ 1 . t o _ i ] . c l a s s _ i d ] . n a m e   :   " " 
 
       e n d 
 
       # E n d   n e w   c o m m a n d 
 
       
 
     # N E W 
 
     # D u b e a l e x ' s   S h o w   C u r r e n t   M a p   N a m e   F e a t u r e 
 
       @ n o w _ t e x t . g s u b ! ( / \ \ [ M m ] a p / )   d o 
 
       $ g a m e _ m a p . n a m e         ! =   n i l   ?   $ g a m e _ m a p . n a m e         :   " " 
 
       e n d 
 
       # E n d   n e w   c o m m a n d 
 
       
 
     # N E W 
 
     # D u b e a l e x ' s   C h o o s e   N a m e   B o x   T e x t   C o l o r 
 
       @ n o w _ t e x t . g s u b ! ( / \ \ [ Z z ] \ [ ( [ 0 - 9 ] + ) \ ] / )   d o 
 
       $ a m s . n a m e _ b o x _ t e x t _ c o l o r = $ 1 . t o _ i 
 
       @ n o w _ t e x t . s u b ! ( / \ \ [ Z z ] \ [ ( [ 0 - 9 ] + ) \ ] / )   {   " "   } 
 
       e n d 
 
       # E n d   n e w   c o m m a n d 
 
       
 
     n a m e _ w i n d o w _ s e t   =   f a l s e 
 
     i f   ( / \ \ [ N n ] a m e \ [ ( . + ? ) \ ] / . m a t c h ( @ n o w _ t e x t ) )   ! =   n i l 
 
         n a m e _ w i n d o w _ s e t   =   t r u e 
 
         n a m e _ t e x t   =   $ 1 
 
         @ n o w _ t e x t . s u b ! ( / \ \ [ N n ] a m e \ [ ( . * ? ) \ ] / )   {   " "   } 
 
     e n d 
 
 
 
     i f   ( / \ \ [ P p ] \ [ ( [ - 1 , 0 - 9 ] + ) \ ] / . m a t c h ( @ n o w _ t e x t ) ) ! = n i l   t h e n 
 
         @ p o p c h a r   =   $ 1 . t o _ i 
 
         i f   @ p o p c h a r   = =   - 1 
 
             @ x   =   @ i n d e n t   =   4 8 
 
             @ y   =   4 
 
         e n d 
 
         @ n o w _ t e x t . g s u b ! ( / \ \ [ P p ] \ [ ( [ - 1 , 0 - 9 ] + ) \ ] / )   {   " "   } 
 
     e n d 
 
 
 
     @ m a x _ c h o i c e _ x   =   0 
 
     i f   @ p o p c h a r   > =   0 
 
         @ t e x t _ s a v e   =   @ n o w _ t e x t . c l o n e 
 
         @ m a x _ x   =   0 
 
         @ m a x _ y   =   4 
 
         f o r   i   i n   0 . . 3 
 
             l i n e   =   @ n o w _ t e x t . s p l i t ( / \ n / ) [ 3 - i ] 
 
             @ m a x _ y   - =   1   i f   l i n e   = =   n i l   a n d   @ m a x _ y   < =   4 - i 
 
             n e x t   i f   l i n e   = =   n i l 
 
             l i n e . g s u b ! ( / \ \ \ w \ [ ( \ w + ) \ ] / )   {   " "   } 
 
             c x   =   c o n t e n t s . t e x t _ s i z e ( l i n e ) . w i d t h 
 
             @ m a x _ x   =   c x   i f   c x   >   @ m a x _ x 
 
             i f   i   > =   $ g a m e _ t e m p . c h o i c e _ s t a r t 
 
                 @ m a x _ c h o i c e _ x   =   c x   i f   c x   >   @ m a x _ c h o i c e _ x 
 
             e n d 
 
         e n d 
 
         s e l f . w i d t h   =   @ m a x _ x   +   3 2   +   @ f a c e _ i n d e n t 
 
         s e l f . h e i g h t   =   ( @ m a x _ y   -   1 )   *   3 2   +   6 4 
 
         @ m a x _ c h o i c e _ x   - =   6 8 
 
         @ m a x _ c h o i c e _ x   - =   @ f a c e _ i n d e n t * 2 1 6 / 1 2 8 
 
     e l s e 
 
         @ m a x _ x   =   s e l f . w i d t h   -   3 2   -   @ f a c e _ i n d e n t 
 
         f o r   i   i n   0 . . 3 
 
             l i n e   =   @ n o w _ t e x t . s p l i t ( / \ n / ) [ i ] 
 
             n e x t   i f   l i n e   = =   n i l 
 
             l i n e . g s u b ! ( / \ \ \ w \ [ ( \ w + ) \ ] / )   {   " "   } 
 
             c x   =   c o n t e n t s . t e x t _ s i z e ( l i n e ) . w i d t h 
 
             i f   i   > =   $ g a m e _ t e m p . c h o i c e _ s t a r t 
 
                 @ m a x _ c h o i c e _ x   =   c x   i f   c x   >   @ m a x _ c h o i c e _ x 
 
             e n d 
 
         e n d 
 
         @ m a x _ c h o i c e _ x   + =   8 
 
     e n d 
 
     @ c u r s o r _ w i d t h   =   0 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ \ \ / )   {   " \ 0 0 0 "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ C c ] \ [ ( [ 0 1 2 3 4 5 6 7 8 9 A B C D E F # ] + ) \ ] / )   {   " \ 0 0 1 [ # { $ 1 } ] "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ G g ] / )   {   " \ 0 0 2 "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ S s ] \ [ ( [ 0 - 9 ] + ) \ ] / )   {   " \ 0 0 3 [ # { $ 1 } ] "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ A a ] \ [ ( . * ? ) \ ] / )   {   " \ 0 0 4 [ # { $ 1 } ] "   } 
 
     
 
       # N E W   
 
       # D u b e a l e x ' s   P e r m a n e n t   C o l o r   C h a n g e 
 
       @ n o w _ t e x t . g s u b ! ( / \ \ [ C c ] o l o r \ [ ( [ 0 - 9 ] + ) \ ] / )   d o 
 
           $ a m s . m e s s a g e _ b o x _ t e x t _ c o l o r =   $ 1 . t o _ i 
 
         @ n o w _ t e x t . s u b ! ( / \ \ [ C c ] \ [ ( [ 0 - 9 ] + ) \ ] / )   {   " "   } 
 
           e n d 
 
       # E n d   o f   n e w   c o m m a n d 
 
       
 
       # N E W   
 
       # D u b e a l e x ' s   F o n t   C h a n g e   F e a t u r e 
 
         @ n o w _ t e x t . g s u b ( / \ \ [ T t ] \ [ ( . * ? ) \ ] / )   d o 
 
           b u f t x t   =   $ 1 . t o _ s 
 
           $ a m s . f o n t _ t y p e   =   b u f t x t 
 
           @ n o w _ t e x t . s u b ! ( / \ \ [ T t ] \ [ ( . * ? ) \ ] / )   {   " "   } 
 
           e n d 
 
       # E n d   o f   n e w   c o m m a n d 
 
       
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ . ] / )   {   " \ 0 0 5 "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ | ] / )   {   " \ 0 0 6 "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ > ] / )   {   " \ 0 1 6 "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ < ] / )   {   " \ 0 1 7 "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ ! ] / )   {   " \ 0 2 0 "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ ~ ] / )   {   " \ 0 2 1 "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ E e ] \ [ ( [ 0 - 9 ] + ) \ ] / )   {   " \ 0 2 2 [ # { $ 1 } ] "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ I i ] / )   {   " \ 0 2 3 "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ O o ] \ [ ( [ 0 - 9 ] + ) \ ] / )   {   " \ 0 2 4 [ # { $ 1 } ] "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ H h ] \ [ ( [ 0 - 9 ] + ) \ ] / )   {   " \ 0 2 5 [ # { $ 1 } ] "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ B b ] \ [ ( [ 0 - 9 ] + ) \ ] / )   {   " \ 0 2 6 [ # { $ 1 } ] "   } 
 
     @ n o w _ t e x t . g s u b ! ( / \ \ [ R r ] \ [ ( . * ? ) \ ] / )   {   " \ 0 2 7 [ # { $ 1 } ] "   } 
 
     
 
     r e s e t _ w i n d o w 
 
     
 
     i f   n a m e _ w i n d o w _ s e t 
 
         c o l o r = $ a m s . n a m e _ b o x _ t e x t _ c o l o r 
 
         o f f _ x   =     $ a m s . n a m e _ b o x _ x _ o f f s e t 
 
         o f f _ y   =     $ a m s . n a m e _ b o x _ y _ o f f s e t 
 
         s p a c e   =   2 
 
         x   =   s e l f . x   +   o f f _ x   -   s p a c e   /   2 
 
         y   =   s e l f . y   +   o f f _ y   -   s p a c e   /   2 
 
         w   =   s e l f . c o n t e n t s . t e x t _ s i z e ( n a m e _ t e x t ) . w i d t h   +   $ a m s . n a m e _ b o x _ w i d t h   +   s p a c e 
 
         h   =   $ a m s . n a m e _ b o x _ h e i g h t   +   s p a c e 
 
         @ n a m e _ w i n d o w _ f r a m e   =   W i n d o w _ F r a m e . n e w ( x ,   y ,   w ,   h ) 
 
         @ n a m e _ w i n d o w _ f r a m e . z   =   s e l f . z   +   1 
 
         x   =   s e l f . x   +   o f f _ x   +   4 
 
         y   =   s e l f . y   +   o f f _ y 
 
         @ n a m e _ w i n d o w _ t e x t     =   A i r _ T e x t . n e w ( x ,   y ,   n a m e _ t e x t ,   c o l o r ) 
 
         @ n a m e _ w i n d o w _ t e x t . z   =   s e l f . z   +   2 
 
     e n d 
 
 e n d 
 
 
 
 r e s e t _ w i n d o w 
 
 
 
 i f   $ g a m e _ t e m p . c h o i c e _ m a x   >   0 
 
     @ i t e m _ m a x   =   $ g a m e _ t e m p . c h o i c e _ m a x 
 
     s e l f . a c t i v e   =   t r u e 
 
     s e l f . i n d e x   =   0 
 
 e n d 
 
 
 
 i f   $ g a m e _ t e m p . n u m _ i n p u t _ v a r i a b l e _ i d   >   0 
 
     d i g i t s _ m a x   =   $ g a m e _ t e m p . n u m _ i n p u t _ d i g i t s _ m a x 
 
     n u m b e r   =   $ g a m e _ v a r i a b l e s [ $ g a m e _ t e m p . n u m _ i n p u t _ v a r i a b l e _ i d ] 
 
     @ i n p u t _ n u m b e r _ w i n d o w   =   W i n d o w _ I n p u t N u m b e r . n e w ( d i g i t s _ m a x ) 
 
     @ i n p u t _ n u m b e r _ w i n d o w . n u m b e r   =   n u m b e r 
 
     @ i n p u t _ n u m b e r _ w i n d o w . x   =   s e l f . x   +   8 
 
     @ i n p u t _ n u m b e r _ w i n d o w . y   =   s e l f . y   +   $ g a m e _ t e m p . n u m _ i n p u t _ s t a r t   *   3 2 
 
 e n d 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   u p d a t e 
 
   
 
 s u p e r 
 
 
 
 i f   @ f a d e _ i n 
 
     s e l f . c o n t e n t s _ o p a c i t y   + =   2 4 
 
     i f   @ i n p u t _ n u m b e r _ w i n d o w   ! =   n i l 
 
         @ i n p u t _ n u m b e r _ w i n d o w . c o n t e n t s _ o p a c i t y   + =   2 4 
 
     e n d 
 
     i f   s e l f . c o n t e n t s _ o p a c i t y   = =   2 5 5 
 
         @ f a d e _ i n   =   f a l s e 
 
     e n d 
 
     r e t u r n 
 
 e n d 
 
 @ n o w _ t e x t   =   n i l   i f   @ n o w _ t e x t   = =   " "   
 
 
 
 i f   @ n o w _ t e x t   ! =   n i l   a n d   @ m i d _ s t o p   = =   f a l s e 
 
     i f   @ w r i t e _ w a i t   >   0 
 
         @ w r i t e _ w a i t   - =   1 
 
         r e t u r n 
 
     e n d 
 
     t e x t _ n o t _ s k i p   =   L E T T E R _ B Y _ L E T T E R _ M O D E 
 
     w h i l e   t r u e 
 
         @ m a x _ x   =   @ x   i f   @ m a x _ x   <   @ x 
 
         @ m a x _ y   =   @ y   i f   @ m a x _ y   <   @ y 
 
         i f   ( c   =   @ n o w _ t e x t . s l i c e ! ( / . / m ) )   ! =   n i l 
 
             i f   c   = =   " \ 0 0 0 " 
 
                 c   =   " \ \ " 
 
             e n d 
 
             
 
             i f   c   = =   " \ 0 0 1 " 
 
                 @ n o w _ t e x t . s u b ! ( / \ [ ( [ 0 1 2 3 4 5 6 7 8 9 A B C D E F # ] + ) \ ] / ,   " " ) 
 
                 t e m p _ c o l o r   =   $ 1 
 
                 c o l o r   =   t e m p _ c o l o r . t o _ i 
 
                 l e a d i n g _ x   =   t e m p _ c o l o r . t o _ s . s l i c e ! ( / . / m ) 
 
                 i f   l e a d i n g _ x   = =   " # " 
 
                     s e l f . c o n t e n t s . f o n t . c o l o r   =   h e x _ c o l o r ( t e m p _ c o l o r ) 
 
                     n e x t 
 
                 e n d 
 
                 i f   c o l o r   > =   0   a n d   c o l o r   < =   7 
 
                     s e l f . c o n t e n t s . f o n t . c o l o r   =   t e x t _ c o l o r ( c o l o r ) 
 
                 e n d 
 
                 n e x t 
 
             e n d 
 
 
 
             i f   c   = =   " \ 0 0 2 " 
 
                 i f   @ g o l d _ w i n d o w   = =   n i l   a n d   @ p o p c h a r   < =   0 
 
                     @ g o l d _ w i n d o w   =   W i n d o w _ G o l d . n e w 
 
                     @ g o l d _ w i n d o w . x   =   5 6 0   -   @ g o l d _ w i n d o w . w i d t h 
 
                     i f   $ g a m e _ t e m p . i n _ b a t t l e 
 
                         @ g o l d _ w i n d o w . y   =   1 9 2 
 
                     e l s e 
 
                         @ g o l d _ w i n d o w . y   =   s e l f . y   > =   1 2 8   ?   3 2   :   3 8 4 
 
                     e n d 
 
                     @ g o l d _ w i n d o w . o p a c i t y   =   s e l f . o p a c i t y 
 
                     @ g o l d _ w i n d o w . b a c k _ o p a c i t y   =   s e l f . b a c k _ o p a c i t y 
 
                 e n d 
 
                 c   =   " " 
 
             e n d 
 
 
 
             i f   c   = =   " \ 0 0 3 " 
 
                 @ n o w _ t e x t . s u b ! ( / \ [ ( [ 0 - 9 ] + ) \ ] / ,   " " ) 
 
                 s p e e d   =   $ 1 . t o _ i 
 
                 i f   s p e e d   > =   0   a n d   s p e e d   < =   1 9 
 
                     @ w r i t e _ s p e e d   =   s p e e d 
 
                 e n d 
 
                 c   =   " " 
 
             e n d 
 
 
 
             i f   c   = =   " \ 0 0 4 " 
 
                 @ n o w _ t e x t . s u b ! ( / \ [ ( . * ? ) \ ] / ,   " " ) 
 
                 b u f t x t   =   $ 1 . d u p . t o _ s 
 
                 i f   b u f t x t . m a t c h ( / \ / / )   = =   n i l   a n d   b u f t x t   ! =   " "   t h e n 
 
                     $ s o u n d n a m e _ o n _ s p e a k   =   " A u d i o / S E / "   +   b u f t x t 
 
                 e l s e 
 
                     $ s o u n d n a m e _ o n _ s p e a k   =   b u f t x t . d u p 
 
                 e n d 
 
                 c   =   " " 
 
             e l s i f   c   = =   " \ 0 0 4 "   
 
                 c   =   " " 
 
             e n d 
 
             
 
             i f   c   = =   " \ 0 0 5 " 
 
                 @ w r i t e _ w a i t   + =   5 
 
                 c   =   " " 
 
             e n d 
 
             
 
             i f   c   = =   " \ 0 0 6 " 
 
                 @ w r i t e _ w a i t   + =   2 0 
 
                 c   =   " " 
 
             e n d 
 
             
 
             i f   c   = =   " \ 0 1 6 " 
 
                 t e x t _ n o t _ s k i p   =   f a l s e 
 
                 c   =   " " 
 
             e n d 
 
             
 
             i f   c   = =   " \ 0 1 7 " 
 
                 t e x t _ n o t _ s k i p   =   t r u e 
 
                 c   =   " " 
 
             e n d 
 
             
 
             i f   c   = =   " \ 0 2 0 " 
 
                 @ m i d _ s t o p   =   t r u e 
 
                 c   =   " " 
 
             e n d 
 
             
 
             i f   c   = =   " \ 0 2 1 " 
 
                 t e r m i n a t e _ m e s s a g e 
 
                 r e t u r n 
 
             e n d 
 
             
 
             i f   c   = =   " \ 0 2 3 " 
 
                 @ i n d e n t   =   @ x 
 
                 c   =   " " 
 
             e n d 
 
 
 
             i f   c   = =   " \ 0 2 4 " 
 
                 @ n o w _ t e x t . s u b ! ( / \ [ ( [ 0 - 9 ] + ) \ ] / ,   " " ) 
 
                 @ o p a c i t y   =   $ 1 . t o _ i 
 
                 c o l o r   =   s e l f . c o n t e n t s . f o n t . c o l o r 
 
                 s e l f . c o n t e n t s . f o n t . n a m e   =   $ a m s . f o n t _ t y p e 
 
                 s e l f . c o n t e n t s . f o n t . s i z e   =   $ a m s . f o n t _ s i z e 
 
                 s e l f . c o n t e n t s . f o n t . c o l o r   =   C o l o r . n e w ( c o l o r . r e d ,   c o l o r . g r e e n ,   c o l o r . b l u e ,   c o l o r . a l p h a   *   @ o p a c i t y   /   2 5 5 ) 
 
                 c   =   " " 
 
             e n d 
 
 
 
             i f   c   = =   " \ 0 2 5 " 
 
                 @ n o w _ t e x t . s u b ! ( / \ [ ( [ 0 - 9 ] + ) \ ] / ,   " " ) 
 
                 s e l f . c o n t e n t s . f o n t . s i z e   =   [ [ $ 1 . t o _ i ,   6 ] . m a x ,   3 2 ] . m i n 
 
                 c   =   " " 
 
             e n d 
 
 
 
             i f   c   = =   " \ 0 2 6 " 
 
                 @ n o w _ t e x t . s u b ! ( / \ [ ( [ 0 - 9 ] + ) \ ] / ,   " " ) 
 
                 @ x   + =   $ 1 . t o _ i 
 
                 c   =   " " 
 
             e n d 
 
             
 
             i f   c   = =   " \ 0 2 7 " 
 
                 @ n o w _ t e x t . s u b ! ( / \ [ ( . * ? ) \ ] / ,   " " ) 
 
                 @ x   + =   r u b y _ d r a w _ t e x t ( s e l f . c o n t e n t s ,   @ x ,   @ y   *   l i n e _ h e i g h t   +   ( l i n e _ h e i g h t   -   s e l f . c o n t e n t s . f o n t . s i z e ) ,   $ 1 ,   @ o p a c i t y ) 
 
                 i f   $ s o u n d n a m e _ o n _ s p e a k   ! =   " " 
 
                     A u d i o . s e _ p l a y ( $ s o u n d n a m e _ o n _ s p e a k ) 
 
                 e n d 
 
             c   =   " " 
 
             e n d 
 
 
 
             i f   c   = =   " \ 0 3 0 " 
 
                 @ n o w _ t e x t . s u b ! ( / \ [ ( . * ? ) \ ] / ,   " " ) 
 
                 s e l f . c o n t e n t s . b l t ( @ x   ,   @ y   *   l i n e _ h e i g h t   +   8 ,   R P G : : C a c h e . i c o n ( $ 1 ) ,   R e c t . n e w ( 0 ,   0 ,   2 4 ,   2 4 ) ) 
 
                 i f   $ s o u n d n a m e _ o n _ s p e a k   ! =   " " 
 
                     A u d i o . s e _ p l a y ( $ s o u n d n a m e _ o n _ s p e a k ) 
 
                 e n d 
 
                 @ x   + =   2 4 
 
                 c   =   " " 
 
             e n d 
 
 
 
             i f   c   = =   " \ n " 
 
                 @ l i n e s   + =   1 
 
                 @ y   + =   1 
 
                 @ x   =   0   +   @ i n d e n t   +   @ f a c e _ i n d e n t 
 
                 i f   @ l i n e s   > =   $ g a m e _ t e m p . c h o i c e _ s t a r t 
 
                     @ x   =   8   +   @ i n d e n t   +   @ f a c e _ i n d e n t 
 
                     @ c u r s o r _ w i d t h   =   @ m a x _ c h o i c e _ x 
 
                 e n d 
 
                 c   =   " " 
 
             e n d 
 
             
 
             i f   c   = =   " \ 0 2 2 " 
 
                 @ n o w _ t e x t . s u b ! ( / \ [ ( [ 0 - 9 ] + ) \ ] / ,   " " ) 
 
                 @ x   + =   g a i j i _ d r a w ( 4   +   @ x ,   @ y   *   l i n e _ h e i g h t   +   ( l i n e _ h e i g h t   -   s e l f . c o n t e n t s . f o n t . s i z e ) ,   $ 1 . t o _ i ) 
 
                 c   =   " " 
 
             e n d 
 
             
 
             # N E W 
 
             # D u b e a l e x ' s   T e x t   S k i p   O n / O F F   C o m m a n d 
 
               i f   c   = =   " \ 1 0 0 " 
 
                     i f   @ a l e x _ s k i p = = f a l s e 
 
                           @ a l e x _ s k i p = t r u e 
 
                     e l s e 
 
                         @ a l e x _ s k i p = f a l s e 
 
                     e n d 
 
                   c   =   " " 
 
               e n d     
 
               # e n d   o f   n e w   c o m m a n d 
 
                                                                       
 
             i f   c   ! =   " " 
 
                 s e l f . c o n t e n t s . d r a w _ t e x t ( 0 + @ x ,   3 2   *   @ y ,   4 0 ,   3 2 ,   c ) 
 
                 @ x   + =   s e l f . c o n t e n t s . t e x t _ s i z e ( c ) . w i d t h 
 
                 i f   $ s o u n d n a m e _ o n _ s p e a k   ! =   " "   t h e n 
 
                     A u d i o . s e _ p l a y ( $ s o u n d n a m e _ o n _ s p e a k ) 
 
                 e n d 
 
             e n d 
 
             
 
 # S K I P _ T E X T _ C O D E 
 
 
 
 #   B   =   E s c a p e ,   0   ( O n   T h e   N u m P a d ) ,   X   
 
 #   C   =   E n t e r ,   S p a c e   B a r   a n d   C 
 
 #   A   =   S h i f t ,   Z   
 
 
 
     i f   I n p u t . p r e s s ? ( I n p u t : : C )   #   < - -   C h a n g e   t h e   v a l u e   o n   t h a t   l i n e 
 
         i f   @ a l e x _ s k i p = = f a l s e             
 
         t e x t _ n o t _ s k i p   =   f a l s e 
 
         e n d 
 
             e n d 
 
         e l s e 
 
             t e x t _ n o t _ s k i p   =   t r u e 
 
             b r e a k 
 
         e n d 
 
         
 
         i f   t e x t _ n o t _ s k i p 
 
             b r e a k 
 
         e n d 
 
     e n d 
 
     @ w r i t e _ w a i t   + =   @ w r i t e _ s p e e d 
 
     r e t u r n 
 
 e n d 
 
 
 
 i f   @ i n p u t _ n u m b e r _ w i n d o w   ! =   n i l 
 
     @ i n p u t _ n u m b e r _ w i n d o w . u p d a t e 
 
     i f   I n p u t . t r i g g e r ? ( I n p u t : : C ) 
 
         $ g a m e _ s y s t e m . s e _ p l a y ( $ d a t a _ s y s t e m . d e c i s i o n _ s e ) 
 
         $ g a m e _ v a r i a b l e s [ $ g a m e _ t e m p . n u m _ i n p u t _ v a r i a b l e _ i d ]   = 
 
             @ i n p u t _ n u m b e r _ w i n d o w . n u m b e r 
 
         $ g a m e _ m a p . n e e d _ r e f r e s h   =   t r u e 
 
         @ i n p u t _ n u m b e r _ w i n d o w . d i s p o s e 
 
         @ i n p u t _ n u m b e r _ w i n d o w   =   n i l 
 
         t e r m i n a t e _ m e s s a g e 
 
     e n d 
 
     r e t u r n 
 
 e n d 
 
 
 
 i f   @ c o n t e n t s _ s h o w i n g 
 
     i f   $ g a m e _ t e m p . c h o i c e _ m a x   = =   0 
 
         s e l f . p a u s e   =   t r u e 
 
     e n d 
 
     
 
     i f   I n p u t . t r i g g e r ? ( I n p u t : : B ) 
 
         i f   $ g a m e _ t e m p . c h o i c e _ m a x   >   0   a n d   $ g a m e _ t e m p . c h o i c e _ c a n c e l _ t y p e   >   0 
 
             $ g a m e _ s y s t e m . s e _ p l a y ( $ d a t a _ s y s t e m . c a n c e l _ s e ) 
 
             $ g a m e _ t e m p . c h o i c e _ p r o c . c a l l ( $ g a m e _ t e m p . c h o i c e _ c a n c e l _ t y p e   -   1 ) 
 
             t e r m i n a t e _ m e s s a g e 
 
         e n d 
 
     e n d 
 
     
 
     i f   I n p u t . t r i g g e r ? ( I n p u t : : C ) 
 
         i f   $ g a m e _ t e m p . c h o i c e _ m a x   >   0 
 
             $ g a m e _ s y s t e m . s e _ p l a y ( $ d a t a _ s y s t e m . d e c i s i o n _ s e ) 
 
             $ g a m e _ t e m p . c h o i c e _ p r o c . c a l l ( s e l f . i n d e x ) 
 
         e n d 
 
         i f   @ m i d _ s t o p 
 
             @ m i d _ s t o p   =   f a l s e 
 
             r e t u r n 
 
         e l s e 
 
             t e r m i n a t e _ m e s s a g e 
 
         e n d 
 
     e n d 
 
     r e t u r n 
 
 e n d 
 
 
 
 i f   @ f a d e _ o u t   = =   f a l s e   a n d   $ g a m e _ t e m p . m e s s a g e _ t e x t   ! =   n i l 
 
     @ c o n t e n t s _ s h o w i n g   =   t r u e 
 
     $ g a m e _ t e m p . m e s s a g e _ w i n d o w _ s h o w i n g   =   t r u e 
 
     r e f r e s h 
 
     G r a p h i c s . f r a m e _ r e s e t 
 
     s e l f . v i s i b l e   =   t r u e 
 
     s e l f . c o n t e n t s _ o p a c i t y   =   0 
 
     i f   @ i n p u t _ n u m b e r _ w i n d o w   ! =   n i l 
 
         @ i n p u t _ n u m b e r _ w i n d o w . c o n t e n t s _ o p a c i t y   =   0 
 
     e n d 
 
     @ f a d e _ i n   =   t r u e 
 
     r e t u r n 
 
 e n d 
 
 
 
 i f   s e l f . v i s i b l e 
 
     @ f a d e _ o u t   =   t r u e 
 
     s e l f . o p a c i t y   - =   4 8 
 
     i f   s e l f . o p a c i t y   = =   0 
 
         s e l f . v i s i b l e   =   f a l s e 
 
         @ f a d e _ o u t   =   f a l s e 
 
         $ g a m e _ t e m p . m e s s a g e _ w i n d o w _ s h o w i n g   =   f a l s e 
 
     e n d 
 
     r e t u r n 
 
 e n d 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   g e t _ c h a r a c t e r ( p a r a m e t e r ) 
 
 
 
 c a s e   p a r a m e t e r 
 
 w h e n   0     
 
     r e t u r n   $ g a m e _ p l a y e r 
 
 e l s e   
 
     e v e n t s   =   $ g a m e _ m a p . e v e n t s 
 
     r e t u r n   e v e n t s   = =   n i l   ?   n i l   :   e v e n t s [ p a r a m e t e r ] 
 
 e n d 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   r e s e t _ w i n d o w 
 
 
 
 # M E S S A G E _ S I Z E 
 
 # M E S S A G E _ P O S I T I O N 
 
 
 
 i f   @ p o p c h a r   > =   0 
 
     e v e n t s   =   $ g a m e _ m a p . e v e n t s 
 
     i f   e v e n t s   ! =   n i l 
 
         c h a r a c t e r   =   g e t _ c h a r a c t e r ( @ p o p c h a r ) 
 
         x   =   [ [ c h a r a c t e r . s c r e e n _ x   -     $ a m s . e v e n t _ m e s s a g e _ x _ o f s e t   -   s e l f . w i d t h   /   2 ,   4 ] . m a x ,   6 3 6   -   s e l f . w i d t h ] . m i n 
 
         y   =   [ [ c h a r a c t e r . s c r e e n _ y   -   $ a m s . e v e n t _ m e s s a g e _ y _ o f s e t   -   s e l f . h e i g h t ,   4 ] . m a x ,   4 7 6   -   s e l f . h e i g h t ] . m i n 
 
         s e l f . x   =   x 
 
         s e l f . y   =   y 
 
     e n d 
 
 e l s i f   @ p o p c h a r   = =   - 1 
 
     s e l f . x   =   - 4 
 
     s e l f . y   =   - 4 
 
     s e l f . w i d t h   =   6 4 8 
 
     s e l f . h e i g h t   =   4 8 8 
 
 e l s e 
 
     i f   $ g a m e _ t e m p . i n _ b a t t l e 
 
         s e l f . y   =   1 6 
 
     e l s e 
 
         c a s e   $ g a m e _ s y s t e m . m e s s a g e _ p o s i t i o n 
 
         w h e n   0     
 
             s e l f . y   =   $ a m s . m e s s a g e _ y _ t o p 
 
         w h e n   1     
 
             s e l f . y   =   $ a m s . m e s s a g e _ y _ m i d d l e 
 
         w h e n   2     
 
             s e l f . y   =   $ a m s . m e s s a g e _ y _ b o t t o m 
 
         e n d 
 
         s e l f . x   =   $ a m s . m e s s a g e _ x 
 
         i f   @ f a c e _ f i l e   = =   n i l 
 
             s e l f . w i d t h   =   $ a m s . m e s s a g e _ w i d t h 
 
             s e l f . x   =   $ a m s . m e s s a g e _ x 
 
         e l s e 
 
             i f   s e l f . w i d t h   < =   6 0 0 
 
                 s e l f . w i d t h   =   6 0 0 
 
                 s e l f . x   - = 6 0 
 
               e n d   
 
         e n d 
 
         s e l f . h e i g h t   =   $ a m s . m e s s a g e _ h e i g h t 
 
     e n d 
 
 e n d 
 
 s e l f . c o n t e n t s   =   B i t m a p . n e w ( s e l f . w i d t h   -   3 2 ,   s e l f . h e i g h t   -   3 2 ) 
 
 s e l f . c o n t e n t s . f o n t . c o l o r   =   t e x t _ c o l o r ( $ a m s . m e s s a g e _ b o x _ t e x t _ c o l o r ) 
 
 s e l f . c o n t e n t s . f o n t . n a m e   =   $ a m s . f o n t _ t y p e 
 
   s e l f . c o n t e n t s . f o n t . s i z e   =   $ a m s . f o n t _ s i z e 
 
 i f   @ f a c e _ f i l e   ! =   n i l 
 
     s e l f . c o n t e n t s . b l t ( 1 6 ,   1 6 ,   R P G : : C a c h e . p i c t u r e ( @ f a c e _ f i l e ) ,   R e c t . n e w ( 0 ,   0 ,   9 6 ,   9 6 ) ) 
 
 e n d 
 
 i f   @ p o p c h a r   = =   - 1 
 
     s e l f . o p a c i t y   =   2 5 5 
 
     s e l f . b a c k _ o p a c i t y   =   0 
 
 e l s i f   $ g a m e _ s y s t e m . m e s s a g e _ f r a m e   = =   0 
 
     s e l f . o p a c i t y   =   2 5 5 
 
     s e l f . b a c k _ o p a c i t y   =   $ a m s . m e s s a g e _ b o x _ o p a c i t y 
 
 e l s e 
 
     s e l f . o p a c i t y   =   0 
 
     s e l f . b a c k _ o p a c i t y   =   $ a m s . m e s s a g e _ b o x _ o p a c i t y 
 
 e n d 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   g a i j i _ d r a w ( x ,   y ,   n u m ) 
 
 
 
 i f   @ g a i j i _ c a c h e   = =   n i l 
 
     r e t u r n   0 
 
 e l s e 
 
     i f   @ g a i j i _ c a c h e . w i d t h   <   n u m   *   2 4 
 
         r e t u r n   0 
 
     e n d 
 
 
 
     i f   s e l f . c o n t e n t s . f o n t . s i z e   > =   2 0   a n d   s e l f . c o n t e n t s . f o n t . s i z e   < =   2 4 
 
         s i z e   =   2 4 
 
     e l s e 
 
         s i z e   =   s e l f . c o n t e n t s . f o n t . s i z e   *   1 0 0   *   2 4   /   2 2 0 0 
 
     e n d 
 
 
 
     s e l f . c o n t e n t s . s t r e t c h _ b l t ( R e c t . n e w ( x ,   y ,   s i z e ,   s i z e ) ,   @ g a i j i _ c a c h e ,   R e c t . n e w ( n u m   *   2 4 ,   0 ,   2 4 ,   2 4 ) ) 
 
 
 
     i f   $ s o u n d n a m e _ o n _ s p e a k   ! =   " "   t h e n 
 
         A u d i o . s e _ p l a y ( $ s o u n d n a m e _ o n _ s p e a k ) 
 
     e n d 
 
     r e t u r n   s i z e 
 
 e n d 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   l i n e _ h e i g h t 
 
 r e t u r n   3 2 
 
 
 
 i f   s e l f . c o n t e n t s . f o n t . s i z e   > =   2 0   a n d   s e l f . c o n t e n t s . f o n t . s i z e   < =   2 4 
 
     r e t u r n   3 2 
 
 e l s e 
 
     r e t u r n   s e l f . c o n t e n t s . f o n t . s i z e   *   1 5   /   1 0 
 
 e n d 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   r u b y _ d r a w _ t e x t ( t a r g e t ,   x ,   y ,   s t r , o p a c i t y ) 
 
 
 
 s i z e b a c k   =   t a r g e t . f o n t . s i z e 
 
 t a r g e t . f o n t . s i z e   *   3   /   2   >   3 2   ?   r u b y s i z e   =   3 2   -   t a r g e t . f o n t . s i z e   :   r u b y s i z e   =   t a r g e t . f o n t . s i z e   /   2 
 
 r u b y s i z e   =   [ r u b y s i z e ,   6 ] . m a x 
 
 o p a c i t y   =   [ [ o p a c i t y ,   0 ] . m a x ,   2 5 5 ] . m i n 
 
 s p l i t _ s   =   s t r . s p l i t ( / , / ) 
 
 s p l i t _ s [ 0 ]   = =   n i l   ?   s p l i t _ s [ 0 ]   =   " "   :   n i l 
 
 s p l i t _ s [ 1 ]   = =   n i l   ?   s p l i t _ s [ 1 ]   =   " "   :   n i l 
 
 
 
 h e i g h t   =   s i z e b a c k   +   r u b y s i z e 
 
 w i d t h     =   t a r g e t . t e x t _ s i z e ( s p l i t _ s [ 0 ] ) . w i d t h 
 
 
 
 t a r g e t . f o n t . s i z e   =   r u b y s i z e 
 
 r u b y _ w i d t h   =   t a r g e t . t e x t _ s i z e ( s p l i t _ s [ 1 ] ) . w i d t h 
 
 t a r g e t . f o n t . s i z e   =   s i z e b a c k 
 
 
 
 b u f _ w i d t h   =   [ t a r g e t . t e x t _ s i z e ( s p l i t _ s [ 0 ] ) . w i d t h ,   r u b y _ w i d t h ] . m a x 
 
 
 
 w i d t h   -   r u b y _ w i d t h   ! =   0   ?   s u b _ x   =   ( w i d t h   -   r u b y _ w i d t h )   /   2   :   s u b _ x   =   0 
 
 
 
 i f   o p a c i t y   = =   2 5 5 
 
     t a r g e t . f o n t . s i z e   =   r u b y s i z e 
 
     t a r g e t . d r a w _ t e x t ( x   +   s u b _ x ,   y   -   t a r g e t . f o n t . s i z e ,   t a r g e t . t e x t _ s i z e ( s p l i t _ s [ 1 ] ) . w i d t h ,   t a r g e t . f o n t . s i z e ,   s p l i t _ s [ 1 ] ) 
 
     t a r g e t . f o n t . s i z e   =   s i z e b a c k 
 
     t a r g e t . d r a w _ t e x t ( x ,   y ,   w i d t h ,   t a r g e t . f o n t . s i z e ,   s p l i t _ s [ 0 ] ) 
 
     r e t u r n   w i d t h 
 
 e l s e 
 
     i f   @ o p a c i t y _ t e x t _ b u f . w i d t h   <   b u f _ w i d t h   o r   @ o p a c i t y _ t e x t _ b u f . h e i g h t   <   h e i g h t 
 
         @ o p a c i t y _ t e x t _ b u f . d i s p o s e 
 
         @ o p a c i t y _ t e x t _ b u f   =   B i t m a p . n e w ( b u f _ w i d t h ,   h e i g h t ) 
 
     e l s e 
 
         @ o p a c i t y _ t e x t _ b u f . c l e a r 
 
     e n d 
 
     @ o p a c i t y _ t e x t _ b u f . f o n t . s i z e   =   r u b y s i z e 
 
     @ o p a c i t y _ t e x t _ b u f . d r a w _ t e x t ( 0   ,   0 ,   b u f _ w i d t h ,   r u b y s i z e ,   s p l i t _ s [ 1 ] ,   1 ) 
 
     @ o p a c i t y _ t e x t _ b u f . f o n t . s i z e   =   s i z e b a c k 
 
     @ o p a c i t y _ t e x t _ b u f . d r a w _ t e x t ( 0   ,   r u b y s i z e ,   b u f _ w i d t h ,   s i z e b a c k ,   s p l i t _ s [ 0 ] ,   1 ) 
 
     i f   s u b _ x   > =   0 
 
         t a r g e t . b l t ( x ,   y   -   r u b y s i z e ,   @ o p a c i t y _ t e x t _ b u f ,   R e c t . n e w ( 0 ,   0 ,   b u f _ w i d t h ,   h e i g h t ) ,   o p a c i t y ) 
 
     e l s e 
 
         t a r g e t . b l t ( x   +   s u b _ x ,   y   -   r u b y s i z e ,   @ o p a c i t y _ t e x t _ b u f ,   R e c t . n e w ( 0 ,   0 ,   b u f _ w i d t h ,   h e i g h t ) ,   o p a c i t y ) 
 
     e n d 
 
     r e t u r n   w i d t h 
 
 e n d 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   c o n v a r t _ v a l u e ( o p t i o n ,   i n d e x ) 
 
 o p t i o n   = =   n i l   ?   o p t i o n   =   " "   :   n i l 
 
 o p t i o n . d o w n c a s e ! 
 
 
 
 c a s e   o p t i o n 
 
 w h e n   " i " 
 
     u n l e s s   $ d a t a _ i t e m s [ i n d e x ] . n a m e   = =   n i l 
 
         r   =   s p r i n t f ( " \ 0 3 0 [ % s ] % s " ,   $ d a t a _ i t e m s [ i n d e x ] . i c o n _ n a m e ,   $ d a t a _ i t e m s [ i n d e x ] . n a m e ) 
 
     e n d 
 
 w h e n   " w " 
 
     u n l e s s   $ d a t a _ w e a p o n s [ i n d e x ] . n a m e   = =   n i l 
 
         r   =   s p r i n t f ( " \ 0 3 0 [ % s ] % s " ,   $ d a t a _ w e a p o n s [ i n d e x ] . i c o n _ n a m e ,   $ d a t a _ w e a p o n s [ i n d e x ] . n a m e ) 
 
     e n d 
 
 w h e n   " a " 
 
     u n l e s s   $ d a t a _ a r m o r s [ i n d e x ] . n a m e   = =   n i l 
 
         r   =   s p r i n t f ( " \ 0 3 0 [ % s ] % s " ,   $ d a t a _ a r m o r s [ i n d e x ] . i c o n _ n a m e ,   $ d a t a _ a r m o r s [ i n d e x ] . n a m e ) 
 
     e n d 
 
 w h e n   " s " 
 
     u n l e s s   $ d a t a _ s k i l l s [ i n d e x ] . n a m e   = =   n i l 
 
         r   =   s p r i n t f ( " \ 0 3 0 [ % s ] % s " ,   $ d a t a _ s k i l l s [ i n d e x ] . i c o n _ n a m e ,   $ d a t a _ s k i l l s [ i n d e x ] . n a m e ) 
 
     e n d 
 
 e l s e 
 
     r   =   $ g a m e _ v a r i a b l e s [ i n d e x ] 
 
 e n d 
 
 
 
 r   = =   n i l   ?   r   =   " "   :   n i l 
 
 r e t u r n   r 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   d i s p o s e 
 
 t e r m i n a t e _ m e s s a g e 
 
 
 
 i f   @ g a i j i _ c a c h e   ! =   n i l 
 
     u n l e s s   @ g a i j i _ c a c h e . d i s p o s e d ? 
 
         @ g a i j i _ c a c h e . d i s p o s e 
 
     e n d 
 
 e n d 
 
 
 
 u n l e s s   @ o p a c i t y _ t e x t _ b u f . d i s p o s e d ? 
 
     @ o p a c i t y _ t e x t _ b u f . d i s p o s e 
 
 e n d 
 
 
 
 $ g a m e _ t e m p . m e s s a g e _ w i n d o w _ s h o w i n g   =   f a l s e 
 
 i f   @ i n p u t _ n u m b e r _ w i n d o w   ! =   n i l 
 
     @ i n p u t _ n u m b e r _ w i n d o w . d i s p o s e 
 
 e n d 
 
 s u p e r 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   u p d a t e _ c u r s o r _ r e c t 
 
 i f   @ i n d e x   > =   0 
 
     n   =   $ g a m e _ t e m p . c h o i c e _ s t a r t   +   @ i n d e x 
 
     s e l f . c u r s o r _ r e c t . s e t ( 8   +   @ i n d e n t   +   @ f a c e _ i n d e n t ,   n   *   3 2 ,   @ c u r s o r _ w i d t h ,   3 2 ) 
 
 e l s e 
 
     s e l f . c u r s o r _ r e c t . e m p t y 
 
 e n d 
 
 e n d 
 
 e n d 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   W i n d o w _ M e s s a g e   E n d s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C l a s s   W i n d o w _ F r a m e   B e g i n s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 c l a s s   W i n d o w _ F r a m e   <   W i n d o w _ B a s e 
 
 
 
 d e f   i n i t i a l i z e ( x ,   y ,   w i d t h ,   h e i g h t ) 
 
 s u p e r ( x ,   y ,   w i d t h ,   h e i g h t ) 
 
 s e l f . w i n d o w s k i n   =   R P G : : C a c h e . w i n d o w s k i n ( $ a m s . n a m e _ b o x _ s k i n ) 
 
 s e l f . c o n t e n t s   =   n i l 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   d i s p o s e 
 
 s u p e r 
 
 e n d 
 
 e n d 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   W i n d o w _ F r a m e   E n d s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   G a m e _ M a p   A d d i t i o n a l   C o d e   B e g i n s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 c l a s s   G a m e _ M a p 
 
 
 
 # D u b e a l e x ' s   A d d i t i o n   ( f r o m   X R X S )   t o   s h o w   M a p   N a m e   o n   s c r e e n 
 
 d e f   n a m e 
 
   $ m a p _ i n f o s [ @ m a p _ i d ] 
 
 e n d 
 
 e n d 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   G a m e _ M a p   A d d i t i o n a l   C o d e   E n d s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   S c e n e _ T i t l e   A d d i t i o n a l   C o d e   B e g i n s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 c l a s s   S c e n e _ T i t l e 
 
 
 
 # D u b e a l e x ' s   A d d i t i o n   ( f r o m   X R X S )   t o   s h o w   M a p   N a m e   o n   s c r e e n 
 
   $ m a p _ i n f o s   =   l o a d _ d a t a ( " D a t a / M a p I n f o s . r x d a t a " ) 
 
   f o r   k e y   i n   $ m a p _ i n f o s . k e y s 
 
       $ m a p _ i n f o s [ k e y ]   =   $ m a p _ i n f o s [ k e y ] . n a m e 
 
   e n d 
 
   
 
   # D u b e a l e x ' s   a d d i t i o n   t o   s a v e   d a t a   f r o m   t h e   A M S   i n   t h e   s a v e   f i l e s 
 
   $ a m s   =   A M S . n e w 
 
   
 
 e n d 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   S c e n e _ T i t l e   A d d i t i o n a l   C o d e   E n d s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   W i n d o w _ B a s e   A d d i t i o n a l   C o d e   B e g i n s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 c l a s s   W i n d o w _ B a s e   <   W i n d o w 
 
 
 
 # D u b e a l e x   A d d i t i o n   ( f r o m   P h y l o m o r p h i s )   t o   u s e   H T M L   H e x   C o d e   C o l o r s 
 
 d e f   h e x _ c o l o r ( s t r i n g ) 
 
     r e d   =   0 
 
     g r e e n   =   0 
 
     b l u e   =   0 
 
     i f   s t r i n g . s i z e   ! =   6 
 
         p r i n t ( " H e x   s t r i n g s   m u s t   b e   s i x   c h a r a c t e r s   l o n g . " ) 
 
         p r i n t ( " W h i t e   t e x t   w i l l   b e   u s e d . " ) 
 
         r e t u r n   C o l o r . n e w ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   2 5 5 ) 
 
     e n d 
 
     f o r   i   i n   1 . . 6 
 
         s   =   s t r i n g . s l i c e ! ( / . / m ) 
 
         i f   s   = =   " # " 
 
             p r i n t ( " H e x   c o l o r   s t r i n g   m a y   n o t   c o n t a i n   t h e   \ " # \ "   c h a r a c t e r . " ) 
 
             p r i n t ( " W h i t e   t e x t   w i l l   b e   u s e d . " ) 
 
             r e t u r n   C o l o r . n e w ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   2 5 5 ) 
 
         e n d 
 
         v a l u e   =   h e x _ c o n v e r t ( s ) 
 
         i f   v a l u e   = =   - 1 
 
             p r i n t ( " E r r o r   c o n v e r t i n g   h e x   v a l u e . " ) 
 
             p r i n t ( " W h i t e   t e x t   w i l l   b e   u s e d . " ) 
 
             r e t u r n   C o l o r . n e w ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   2 5 5 ) 
 
         e n d 
 
         c a s e   i 
 
         w h e n   1 
 
             r e d   + =   v a l u e   *   1 6 
 
         w h e n   2 
 
             r e d   + =   v a l u e 
 
         w h e n   3 
 
             g r e e n   + =   v a l u e   *   1 6 
 
         w h e n   4 
 
             g r e e n   + =   v a l u e 
 
         w h e n   5 
 
             b l u e   + =   v a l u e   *   1 6 
 
         w h e n   6 
 
             b l u e   + =   v a l u e 
 
         e n d 
 
     e n d 
 
     r e t u r n   C o l o r . n e w ( r e d ,   g r e e n ,   b l u e ,   2 5 5 ) 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   h e x _ c o n v e r t ( c h a r a c t e r ) 
 
     c a s e   c h a r a c t e r 
 
       w h e n   " 0 " 
 
           r e t u r n   0 
 
     w h e n   " 1 " 
 
           r e t u r n   1 
 
     w h e n   " 2 " 
 
           r e t u r n   2 
 
     w h e n   " 3 " 
 
           r e t u r n   3 
 
     w h e n   " 4 " 
 
           r e t u r n   4 
 
     w h e n   " 5 " 
 
           r e t u r n   5 
 
     w h e n   " 6 " 
 
           r e t u r n   6 
 
     w h e n   " 7 " 
 
           r e t u r n   7 
 
     w h e n   " 8 " 
 
           r e t u r n   8 
 
     w h e n   " 9 " 
 
           r e t u r n   9 
 
     w h e n   " A " 
 
           r e t u r n   1 0 
 
     w h e n   " B " 
 
           r e t u r n   1 1 
 
     w h e n   " C " 
 
           r e t u r n   1 2 
 
     w h e n   " D " 
 
           r e t u r n   1 3 
 
     w h e n   " E " 
 
           r e t u r n   1 4 
 
     w h e n   " F " 
 
           r e t u r n   1 5 
 
       e n d 
 
     r e t u r n   - 1 
 
 e n d 
 
 e n d 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   W i n d o w _ B a s e   A d d i t i o n a l   C o d e   E n d s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C l a s s   A i r _ T e x t   B e g i n s   
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 c l a s s   A i r _ T e x t   <   W i n d o w _ B a s e 
 
 
 
 d e f   i n i t i a l i z e ( x ,   y ,   d e s i g n a t e _ t e x t ,   c o l o r = 0 ) 
 
   
 
 s u p e r ( x - 1 6 ,   y - 1 6 ,   3 2   +   d e s i g n a t e _ t e x t . s i z e   *   1 2 ,   5 6 ) 
 
 s e l f . o p a c i t y             =   0 
 
 s e l f . b a c k _ o p a c i t y   =   0 
 
 s e l f . c o n t e n t s   =   B i t m a p . n e w ( s e l f . w i d t h   -   3 2 ,   s e l f . h e i g h t   -   3 2 ) 
 
 w   =   s e l f . c o n t e n t s . w i d t h 
 
 h   =   s e l f . c o n t e n t s . h e i g h t 
 
 s e l f . c o n t e n t s . f o n t . n a m e   =   $ a m s . n a m e _ f o n t _ t y p e 
 
 s e l f . c o n t e n t s . f o n t . s i z e   =   $ a m s . n a m e _ f o n t _ s i z e 
 
 s e l f . c o n t e n t s . f o n t . c o l o r   =   t e x t _ c o l o r ( c o l o r ) 
 
 s e l f . c o n t e n t s . d r a w _ t e x t ( 0 ,   0 ,   w ,   h ,   d e s i g n a t e _ t e x t ) 
 
 e n d 
 
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 d e f   d i s p o s e 
 
 s e l f . c o n t e n t s . c l e a r 
 
 s u p e r 
 
 e n d 
 
 e n d   
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   A i r _ T e x t     E n d s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   S c e n e _ S a v e   A d d i t i o n a l   C o d e   B e g i n s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 c l a s s   S c e n e _ S a v e   <   S c e n e _ F i l e 
 
   
 
   a l i a s   a m s _ o r i g i n a l _ w r i t e _ s a v e _ d a t a   w r i t e _ s a v e _ d a t a 
 
   
 
   d e f   w r i t e _ s a v e _ d a t a ( f i l e ) 
 
       a m s _ o r i g i n a l _ w r i t e _ s a v e _ d a t a ( f i l e ) 
 
       M a r s h a l . d u m p ( $ a m s ,   f i l e ) 
 
   e n d 
 
   
 
 e n d 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   S c e n e _ S a v e   A d d i t i o n a l   C o d e   E n d s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   
 
 
 
 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   S c e n e _ L o a d   A d d i t i o n a l   C o d e   B e g i n s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 c l a s s   S c e n e _ L o a d   <   S c e n e _ F i l e 
 
   
 
   a l i a s   a m s _ o r i g i n a l _ r e a d _ s a v e _ d a t a   r e a d _ s a v e _ d a t a 
 
   
 
   d e f   r e a d _ s a v e _ d a t a ( f i l e ) 
 
       a m s _ o r i g i n a l _ r e a d _ s a v e _ d a t a ( f i l e ) 
 
       $ a m s             =   M a r s h a l . l o a d ( f i l e ) 
 
   e n d 
 
   
 
 e n d 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   %  C L A S S   S c e n e _ L o a d   A d d i t i o n a l   C o d e   E n d s 
 
 # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 